<html>
    <head>
        <title>测试报告汇总</title>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
        <meta name="description" content="Mi integration test result."/>
    </head>

    <!--定义变量-->
    <#assign passBtn = '<div class="successBtn">Success</div>' >
    <#assign failBtn = '<div class="failBtn">Fail</div>' >
    <#assign skipBtn = '<div class="skipBtn">Skip</div>' >

<body>
    <div class="head">[${module}] Summary Report</div>
    <div class="box">
        <h3 class="title">报告汇总</h3>
        <div class="main">
            <table style="width: 100%">
                <tr>
                    <th>测试套件</th>
                    <th>用例总数</th>
                    <th>未执行用例数</th>
                    <th>执行通过</th>
                    <th>执行失败</th>
                    <th>跳过用例数</th>
                    <th>执行时间(ms)</th>
                    <th>用例通过率</th>
                </tr>

                <#if beans?size != 0>
                <#list beans as bean>
                <tr>
                    <td>${bean.suiteName}</td>
                    <td>${bean.allTestsSize}</td>
                    <td>${bean.excludeTestsSize}</td>
                    <td>${bean.passedTestsSize}</td>
                    <td>${bean.failedTestsSize}</td>
                    <td>${bean.skippedTestsSize}</td>
                    <td>${bean.testsTime}</td>
                    <td>${bean.passPercent}</td>
                </tr>
                </#list>
                </#if>
            </table>
        </div>
    </div>

    <div class="box">
        <h3 class="title">详细数据</h2>
        <div class="main">
        <table style="width: 100%">
            <tr>
                <th>编号</th>
                <th>Class</th>
                <th>MethodName</th>
                <th>用例描述</th>
                <th>执行结果</th>
                <th>执行时间(ms)</th>
                <th>报错信息</th>
            </tr>

            <#assign caseNo = 0>
            <#list pass as passCase>
            <tr>
                <#assign caseNo=caseNo+1>
                <td>${caseNo}</td>
                <td>${passCase.className}</td>
                <td>${passCase.testName}</td>
                <td>${passCase.description!}</td>
                <td>${passBtn}</td>
                <td>${passCase.duration!}</td>
                <td>${passCase.throwable!}</td>
            </tr>
            </#list>

            <#list fail as failCase>
            <tr>
                <#assign caseNo=caseNo+1>
                <td>${caseNo}</td>
                <td>${failCase.className}</td>
                <td>${failCase.testName}</td>
                <td>${failCase.description!}</td>
                <td>${failBtn}</td>
                <td>${failCase.duration!}</td>
                <td>${failCase.throwable!}</td>
            </tr>
            </#list>

            <#list skip as skipCase>
            <tr>
                <#assign caseNo=caseNo+1>
                <td>${caseNo}</td>
                <td>${skipCase.className}</td>
                <td>${skipCase.testName}</td>
                <td>${skipCase.description!}</td>
                <td>${skipBtn}</td>
                <td>${skipCase.duration!}</td>
                <td>${skipCase.throwable!}</td>
            </tr>
            </#list>
    </table>
    </div>
    </body>
</html>
<style>
        body {
            margin: 10px 20px;
            font-size: 14px;
            font-family: "Arial", "Microsoft YaHei", "黑体", "宋体", sans-serif;
			background: #F3F3F4;
        }
        table {
            border-collapse: collapse;
            font-size: 14px;
			color: #666;
			text-align: center;
        }
		table th{
			background: #1AB394;
			color: #ffffff;
			border: 1px solid #1AB394;
            padding: 12px 10px;
		}
        table td{
            border: 1px solid #E7E7E7;
            padding: 10px;
			text-align: left;
        }
		tr:nth-child(2n+1){
			background: #F5F5F6;
		}
        .successBtn {
			margin: auto;
            width: 70px;
			height: 20px;
            background-color: #61A0A8;
            border-color: #61A0A8;
            color: #fff;
            border-radius: 5px;
            text-align: center;
            font-weight: 500;
			line-height: 14px;
			padding-top: 6px;
        }
		.skipBtn {
			margin: auto;
            width: 70px;
			height: 20px;
            background-color: #2F4554;
            border-color: #2F4554;
            color: #fff;
            border-radius: 5px;
            text-align: center;
            font-weight: 500;
			line-height: 14px;
			padding-top: 6px;
        }
        .failBtn {
			margin: auto;
            width: 70px;
			height: 20px;
            background-color: #ab2e2d;
            border-color: #ab2e2d;
            color: #fff;
            border-radius: 5px;
            text-align: center;
            font-weight: 500;
			line-height: 14px;
			padding-top: 6px;
        }
		.head{
			background: #1AB394;
			color: #ffffff;
			font-size: 30px;
			font-weight: 700;
			text-align: center;
			line-height: 32px;
			padding: 25px 0;
		}
		.box{
			background: #ffffff;
			margin-top: 20px;
		}
		.title{
			color: #676A6C;
			padding: 20px;
			border-bottom: 2px solid #F3F3F4;
			margin: 0;
		}
		.main{
			padding: 20px;
		}
    </style>